<template>
  <div class="wrapper">
    <v-head ></v-head>
    <v-sidebar :sideList ="sideList"></v-sidebar>

    <div class="content-box" :class="{'content-collapse':collapse}">
      <div class="content">
        <transition name="move" mode="out-in">
          <keep-alive :include="tagsList">
            <router-view :items="staff"></router-view>
          </keep-alive>
        </transition>
        <el-backtop target=".content"></el-backtop>
      </div>
    </div>
  </div>
</template>

<script>
  import vHead from '../components/common/Header'
  import vSidebar from '../components/common/Sidebar'
  import vTags from '../components/common/Tags'
  import SelfInfo from '../components/common/SelfInfo'
  import ClientManage from '../components/proMan/ClientManage'
  import StaffManage from '../components/proMan/StaffManage'
  import bus from '../components/common/bus'
  import ProManAddClient from '../components/proMan/ProManAddClient'
  import ProManAddStaff from '../components/proMan/ProManAddStaff'

  export default {
    name: 'ProMan',
    data(){
      return {
        staff:{
          sName:null,
          sId:null,
          sType:null,
          sSex:null,
          sIdNumber:null,
          sAddress:null,
          sTel:null,
          sUsername:null,
        },
        tagsList: [],
        collapse: false,
        sideList://============sidelist//似乎不能动态的改变这个   呜呜呜
          [
            {
              icon:'el-icon-user-solid',
              index:'SelfInfo',//这里 应该是router-link
              title:'个人信息'
            },
            {
              icon:'el-icon-circle-plus-outline',
              index:'ProManAddClient',
              title:'新增客户'
            },
            {
              icon:'el-icon-s-custom',
              index:'ClientManage',
              title:'客户管理'
            },
            {
              icon:'el-icon-circle-plus',
              index:'ProManAddStaff',
              title:'新增员工'
            },
            {
              icon:'el-icon-user',
              index:'StaffManage',
              title:'员工管理'
            }
          ]
      }
    },
    components: {
      SelfInfo,
      vHead,
      vSidebar,
      vTags,
    },
    methods:{

    },
    created () {
      bus.$on('collapse-content', msg => {
        this.collapse = msg;
      });
      console.log('laal')
      console.log(this.$route.query.sName)
      this.staff.sName = this.$route.query.sName,
      this.staff.sId = this.$route.query.sId,
      this.staff.sType = this.$route.query.sType,
      this.staff.sSex = this.$route.query.sSex,
      this.staff.sIdNumber = this.$route.query.sIdNumber,
      this.staff.sAddress = this.$route.query.sAddress,
      this.staff.sTel = this.$route.query.sTel,
      this.staff.sUsername = this.$route.query.sUsername;
    },

  }
</script>

<style scoped>

</style>
